package dd.prog2.exercises.set06.ListsTest;

public class _listsEffTest {

	static int cnt = 50000;
	static long start, stop;

	public static void main(String[] args) {

		myArrayListTest a_List = new myArrayListTest(cnt);
		myLinkedListTest l_List = new myLinkedListTest(cnt);
		System.out.println(cnt+" Elements\n"+"- - - - - - - - - - - - - - - - - - - -");

		start = System.currentTimeMillis();
		a_List.add();
		stop = System.currentTimeMillis();
		System.out.println("ArrayList (Add Last):\t\t"+(stop-start)+" ms");

		start = System.currentTimeMillis();
		l_List.add();
		stop = System.currentTimeMillis();
		System.out.println("LinkedList(Add Last):\t\t"+(stop-start)+" ms\n");

		/*reinit*/
		a_List = new myArrayListTest(cnt);
		l_List = new myLinkedListTest(cnt);

		start = System.currentTimeMillis();
		a_List.addFirst();
		stop = System.currentTimeMillis();
		System.out.println("ArrayList (Add First):\t\t"+(stop-start)+" ms");

		start = System.currentTimeMillis();
		l_List.addFirst();
		stop = System.currentTimeMillis();
		System.out.println("LinkedList(Add First):\t\t"+(stop-start)+" ms\n");

		start = System.currentTimeMillis();
		a_List.seqAccess();
		stop = System.currentTimeMillis();
		System.out.println("ArrayList (Access, Index):\t"+(stop-start)+" ms");

		start = System.currentTimeMillis();
		l_List.seqAccess();
		stop = System.currentTimeMillis();
		System.out.println("LinkedList(Access, Index):\t"+(stop-start)+" ms\n");

		start = System.currentTimeMillis();
		a_List.seqAccessIter();
		stop = System.currentTimeMillis();
		System.out.println("ArrayList (Access, Iterator):\t"+(stop-start)+" ms");

		start = System.currentTimeMillis();
		l_List.seqAccessIter();
		stop = System.currentTimeMillis();
		System.out.println("LinkedList(Access, Iterator):\t"+(stop-start)+" ms\n");
	}
}
